package com.xgpro.common.exceptions;


import com.xgpro.common.enums.ResultCodeEnum;
/**
 * @author tx
 * @version 1.0
 * @date 2019/8/24 12:58
 */
public class BusinessRuntimeException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private String errorCode;

    public BusinessRuntimeException(){

    }

    public BusinessRuntimeException(String message){
        super(message);
    }

    public BusinessRuntimeException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public BusinessRuntimeException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.errorCode = resultCodeEnum.getCode();
    }
}
